package com.zzyy.study.tenant;

/**
 * @auther zzyy
 * @create 2024-07-05 17:19
 */
public final class TenantContextHolder
{
    public static final ThreadLocal<String> TENANT_ID_TL = new ThreadLocal<>();

    public static void setTenantId(String tenantId)
    {
        TENANT_ID_TL.set(tenantId);
    }

    public static void clean()
    {
        TENANT_ID_TL.remove();
    }

    public static String getCurrentTenantId() {
        return TENANT_ID_TL.get();
    }
}
